package com.le.tester.book.effectivejava3.focus2;

/**
 * createTime：2025-06-11 14:56
 * description：用户信息dto
 */
public class UserDto {

    public String name;

    public String phone;

    public int sex;

    public String email;


    public static class Builder {
        public String name;
        public String phone;
        public int sex;
        public String email;

        public Builder() {
        }

        public Builder name(String val) {
            name = val;
            return this;
        }

        public Builder phone(String val) {
            phone = val;
            return this;
        }

        public Builder sex(int val) {
            sex = val;
            return this;
        }

        public Builder email(String val) {
            email = val;
            return this;
        }

        public UserDto build() {
            return new UserDto(this);
        }
    }

    public UserDto(Builder builder) {
        name = builder.name;
        phone = builder.phone;

        sex = builder.sex;
        email = builder.email;
    }

    public String getName() {
        return name;
    }

    public String getPhone() {
        return phone;
    }

    public int getSex() {
        return sex;
    }

    public String getEmail() {
        return email;
    }


}
